package com.liy.supercloud.server.gateway.controller;

import java.util.HashMap;
import java.util.Map;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HystrixController {

    @RequestMapping({"/fallback"})
    public Map<String, Object> fallBackController(Object obj) {
        Map<String, Object> res = new HashMap();
        res.put("status", HttpStatus.INTERNAL_SERVER_ERROR.value());
        res.put("success", false);
        res.put("message", "service not available");
        res.put("timestamp", System.currentTimeMillis());
        return res;
    }
}
